<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});
Route::post('users/by/roles', 'Api\UsersController@getUsersByRoles');
Route::post('areas/rank', 'Api\AreasController@rank');
//用户登录
Route::post('users/login', 'Api\UsersController@login');
Route::post('goods', 'Api\GoodsController@index');
Route::group([
            'prefix' => 'users',
            'middleware' => ['check-login']
            ], function () {
                Route::post('info', 'Api\UsersController@getUserInfo');
                Route::post('details', 'Api\UsersController@getDetails');
                Route::post('logout', 'Api\UsersController@logout');
                Route::post('detailscount', 'Api\UsersController@detailsCount');
                Route::post('ordersubmit', 'Api\UsersController@submit');
                Route::post('product/rank', 'Api\UsersController@productRank');
                Route::post('company/rank', 'Api\UsersController@companyRank');
                Route::post('rank/data', 'Api\UsersController@rankData');

                Route::post('getmyorder', 'Api\DealersController@getMyOrder');
                Route::post('dealer/submit', 'Api\DealersController@submit');
                Route::post('getorderbyusernum', 'Api\DealersController@getOrderByUsernum');

                Route::post('get/order/data', 'Api\UsersController@getOrderData');
            });
//抽奖接口
Route::post('lottery', 'Api\DealersController@lottery');
Route::post('alldetails', 'Api\UsersController@allDetails');
Route::post('users/policy', 'Api\UsersController@orderPolicy');

Route::post('fakers', 'Api\AreasController@fakeRank');

Route::post('getwinners', 'Api\DealersController@getWinners');